A processor executing a pipeline control method includes a branch prediction mechanism being a mechanism predicting a branch to effectively perform an instruction fetch from a memory to an instruction execution unit. In a processor executing an out of order control, there is a case when the instruction fetch is performed prior to an instruction execution, and therefore, importance of the branch prediction mechanism is high.
A branch prediction method storing a record whether or not a conditional branch is performed for each conditional branch instruction executed by a processor is known (for example, refer to Patent Document 1). In this record, plural occurrences of each conditional branch are included in each memory address, and it is predicted whether or not a branch occurs based on the record and a prediction pattern when a conditional branch instruction is executed, and an instruction in an instruction stream is fetched in response to the prediction.
Besides, a branch prediction method predicting whether or not a branch occurs based on a latest actual performance of the conditional branch in the past or yes/no of whether or not the branch predictions for several times in the past hit when the conditional branch instruction is executed, is known (for example, refer to Patent Document 2).
[Patent Document 1] Japanese Laid-open Patent Publication No. H6-59887
[Patent Document 2] Japanese Laid-open Patent Publication No. 2001-14162
When the branch prediction of the conditional branch instruction is performed, it is necessary to record branch results of the past conditional branches, and to record branch prediction information by each conditional branch history pattern in the past. However, there are a lot of kinds in the conditional branch history patterns in the past, and therefore, it takes considerable time to record the branch prediction information by each conditional branch history pattern in the past. There is a problem in which it is difficult to enable a precise branch prediction and an accuracy of the branch prediction becomes low until the above-stated branch prediction information is recorded.